/**
 * @ author: 汪孟苹
 */
define(["jquery", "bbcare", "jqprint", "fu/app/comm/comm",], function ($, $bb, $jqprint, $comm,) {
    var tpl = {}

    tpl.init = function () {
        var html = ''
        html += taskBabycard()
        return html
    }
    tpl.init2 = function () {
        var html = ''
        html += showContainer()
        return html
    }
    tpl.init3 = function () {
        var html = ''
        html += followUpTit()
        return html
    }
    tpl.followupInit = function () {
        var html = ''
        html += followUp()
        html += followupInfo()
        html += collectFlag()
        html += recordGroup()
        return html
    }
    tpl.printInit = function () {
        var html = ''
        html += print()
        html += printLoop()
        return html
    }
    tpl.printTem2Init = function () {
        var html = ''
        html += printTem2()
        html += printTem2Loop()
        return html
    }
    /**
     * 2020 11 12 新增建档打印 lzy
     */
    tpl.printCreate = function () {
        var html = ''
        html += printCreate()
        html += printCreateLoop()
        return html
    }
    tpl.anchorMenuInit = function () {
        var html = ''
        html += anchorMenu()
        return html
    }
    tpl.dischargeSummary = function () {
        return dischargeSummary()
    }
    var taskBabycard = function () {
        return '<script id="tpl_outPatient_taskBabycard" type="text/html">' +
            '	<div class="row task-babycard">' +
            '		<div class="col-sm-2 col-md-2 task-babycard-icon">' +
            '			<img src="{{imgSrc}}">' +
            '		</div>' +
            '		<div class="col-sm-10 col-md-10" style="padding-right: 0;">' +
            '			<div class="task-babycard-name ellipsis-1">{{patientName}}</div>' +
            '			<div class="task-babycard-queuename ellipsis-1">{{queuename}}</div>' +
            '		</div>' +
            '	</div>' +
            '</script>'
    }
    var showContainer = function () {
        return '<script id="tpl_outPatient_showContainer" type="text/html">' +
            '	<div class="show-wrapper clearfix">' +
            '		{{each rows as value i}}' +
            '		<div class="row {{if value.currentTaskFlag}} active{{/if}}">' +
            '			<div class="col-sm-12 col-md-12 task-tit" taskStatus="{{value.taskStatus}}">' +
            '				{{if value.auditStatus =="4"}}<i class="fa fa-question-circle" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="内容待审核"></i>{{/if}}' +
            '				{{value.taskName}}' +
            '				{{if value.taskStatus== "1"}}' +
            '				<i class="fa fa-check-square-o" data-toggle="tooltip" data-placement="left" title="已完成"></i>' +
            '				{{else if value.taskStatus== "2"}}' +
            '				<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="left" title="已过期"></i>' +
            '				{{else if value.currentTaskFlag}}' +
            '				<i class="fa fa-clock-o" data-toggle="tooltip" data-placement="left" title="进行中"></i>' +
            '				{{/if}}' +
            '				{{if value.tempTask=="null"}}' +
            '				<i class="fa fa-pencil-square-o __edit" id="{{value.id}}" date="{{value.executeTime}}" data-toggle="tooltip" data-placement="left" title="点击修改"></i>' +
            '				{{/if}}' +
            '			</div>' +
            '			<div class="col-sm-12 col-md-12 task-time">' +
            '				<span class="taskDate">{{value.taskDate}}</span>' +
            '				{{if value.seqNo!=0}}' +
            '				<span>(±{{value.taskWindowDay}}天)</span>' +
            '				{{/if}}' +
            '			</div>' +
            '		</div>' +
            '		{{/each}}' +
            '	</div>' +
            '</script>'
    }
    var followUpTit = function () {
        return '<script id="tpl_outPatient_followUpTit" type="text/html">' +
            '	<div class="row">' +
            // '		<div class="tag">BBcare-专业的随访平台</div>' +
            '		<div class="col-sm-12 col-md-12 tit">{{queueName}}</div>' +
            '	</div>' +
            '</script>'
    }
    // 随访问卷
    var followUp = function () {
        return '<script id="tpl_outPatient_followUp" type="text/html">' +
            '<div class="form-horizontal" {{if ptTaskId}}id="{{ptTaskId}}"{{/if}} {{if queueId}}id="{{queueId}}"{{/if}}>' +
            '	{{if flagQuestions}}' +
            '	{{if task && task.seqNo != 0}}' +
            '	<div class="clearfix">' +
            '		{{include "tpl_outPatient_followupInfo",task}}' +
            '	</div>' +
            '	{{/if}}' +
            '	{{/if}}' +

            '	{{if flagQuestions}}' +
            '	<div id="questions" class="clearfix"></div>' +
            '	{{/if}}' +

            '	{{if task && task.seqNo != 0}}' +
            '	{{if sampleList}}' +
            '		{{include "tpl_outPatient_collectFlag",sampleList}}' +
            '	{{/if}}' +
            '	{{/if}}' +

            '	{{if flagQuestions}}' +
            '	{{if task && task.seqNo != 0}}' +
            '	{{if flagTaskGuide}}' +
            '	<div class="clearfix">' +
            '		{{include "tpl_outPatient_recordGroup",task}}' +
            '	</div>' +
            '	{{/if}}' +
            '	{{/if}}' +
            '	{{/if}}' +
            '</div>' +
            '</script>'
    }
    // 安医大采集
    var collectFlag = function () {
        return '<script id="tpl_outPatient_collectFlag" type="text/html">' +
            '	{{if flag}}' +	// flag：安医大为true，其他为false
            '		<div class="qaCard-subtit col-sm-12 col-md-12">' +
            '			<div>生物样本收集记录</div>' +
            '		</div>' +
            '		{{each sampleList as value i}}' +
            '		<div class="qaCard form-group form-group-sm col-sm-4 col-md-4 grid-label-6">' +
            '			<label class="control-label">{{value.label}}</label>' +
            '   		<div class="control-input">' +
            '				{{if value.status=="default"}}' +
            '					<select class="form-control" name="{{value.name}}">' +
            '						{{each value.list as item i}}' +
            '   						<option value={{item.key}} {{if value.val == item.key}} selected="selected" {{/if}}>{{item.value}}</option>' +
            '						{{/each}}' +
            '					</select>' +
            '				{{else if value.status=="readonly"}}' +
            '					<p class="form-control-static" name="{{value.name}}">' +
            '						{{each value.list as item i}}' +
            '   						{{if value.val == item.key}}{{item.value}}{{/if}}' +
            '						{{/each}}' +
            '					</p>' +
            '				{{else if value.status=="disabled"}}' +
            '					<select class="form-control" name="{{value.name}}" disabled>' +
            '						{{each value.list as item i}}' +
            '   						<option value={{item.key}} {{if value.val == item.key}} selected="selected" {{/if}}>{{item.value}}</option>' +
            '						{{/each}}' +
            '					</select>' +
            '				{{/if}}' +
            '			</div>' +
            '		</div>' +
            '		{{/each}}' +
            '	{{/if}}' +
            '</script>'
    }
    // 随访指导
    var followupInfo = function () {
        var datay = '<script id="tpl_outPatient_followupInfo" type="text/html">' +
            '	<div class="qaCard-subtit col-sm-12 col-md-12">' +
            '		<div>随访信息</div>' +
            '	</div>' +
            '	<div class="qaCard form-group form-group-sm col-sm-{{length}} col-md-{{length}} grid-label-6">' +
            '		<label class="control-label"><i class="not-null">*</i>随访日期</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '   			<input type="date" class="form-control" name="finishDate" value="{{finishDate}}" placeholder="{{placeHolder}}">' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static" name="finishDate">{{finishDate}}</p>' +
            '			{{else if status=="disabled"}}' +
            '   			<input type="date" class="form-control" name="finishDate" value="{{finishDate}}" placeholder="{{placeHolder}}" disabled>' +
            '			{{/if}}' +
            '  		</div>' +
            '	</div>' +
            '	<div id="followupAge" birthday="{{ageRelate.birthday}}" expectedDay="{{ageRelate.expectedDay}}" pregnancyDay="{{ageRelate.pregnancyDay}}" class="qaCard form-group form-group-sm col-sm-{{length}} col-md-{{length}} grid-label-6">' +
            '		<label class="control-label">{{followupAgeLabel}}</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '				<p class="form-control-static" name="followupAge">{{followupAge}}</p>' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static" name="followupAge">{{followupAge}}</p>' +
            '			{{else if status=="disabled"}}' +
            '   			<input type="text" class="form-control" name="followupAge" value="{{followupAge}}" disabled>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '	{{if followupActualAge}}' +
            '	<div id="followupActualAge" birthday="{{ageRelate.birthday}}" expectedDay="{{ageRelate.expectedDay}}" pregnancyDay="{{ageRelate.pregnancyDay}}" class="qaCard form-group form-group-sm col-sm-{{length}} col-md-{{length}} grid-label-6">' +
            '		<label class="control-label">{{followupActualAgeLabel}}</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '				<p class="form-control-static" name="followupActualAge">{{followupActualAge}}</p>' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static" name="followupActualAge">{{followupActualAge}}</p>' +
            '			{{else if status=="disabled"}}' +
            '   			<input type="text" class="form-control" name="followupActualAge" value="{{followupActualAge}}" disabled>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '	{{/if}}' +
            '	<div class="qaCard form-group form-group-sm col-sm-{{length}} col-md-{{length}} grid-label-6">' +
            '		<label class="control-label">随访医生</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '				<p class="form-control-static" name="updateAuname">{{updateAuname}}</p>' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static" name="updateAuname">{{updateAuname}}</p>' +
            '			{{else if status=="disabled"}}' +
            '   			<input type="text" class="form-control" name="updateAuname" value="{{updateAuname}}" disabled>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '</script>'
        return datay
    }
    // 随访信息
    var recordGroup = function () {
        return '<script id="tpl_outPatient_recordGroup" type="text/html">' +
            '	<div class="qaCard-subtit col-sm-12 col-md-12">' +
            '		<div>随访指导</div>' +
            '	</div>' +
            '	<div class="qaCard form-group form-group-sm col-sm-4 col-md-4 grid-label-6">' +
            '		<label class="control-label">下次随访时间</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '   			<input type="date" class="form-control" name="nextDate" min="{{finishDate}}" value="{{nextTime}}">' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static" name="nextDate">{{nextTime}}</p>' +
            '			{{else if status=="disabled"}}' +
            '   			<input type="date" class="form-control" name="nextDate" min="{{finishDate}}" value="{{nextTime}}" disabled>' +
            '			{{/if}}' +
            '  		</div>' +
            '	</div>' +
            '	<div class="qaCard form-group form-group-sm col-sm-4 col-md-4 grid-label-6">' +
            '		<label class="control-label">下次随访地址</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '				<select class="form-control" name="nextAddress">' +
            '					{{each nextAddress as item i}}' +
            '   					<option>{{item}}</option>' +
            '					{{/each}}' +
            '				</select>' +
            '			{{else if status=="readonly"}}' +
            '				{{if nextAddress!=null&&nextAddress.length>0}}' +
            '					<p class="form-control-static" name="nextAddress">{{nextAddress[0]}}</p>' +
            '				{{else}}' +
            '					<p class="form-control-static">无</p>' +
            '				{{/if}}' +
            '			{{else if status=="disabled"}}' +
            '				<select class="form-control" name="nextAddress" disabled>' +
            '					{{each nextAddress as item i}}' +
            '   					<option>{{item}}</option>' +
            '					{{/each}}' +
            '				</select>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '   <div style="clear:both;"></div>' +
            '	<div class="qaCard form-group form-group-sm col-sm-12 col-md-12 grid-label-6">' +
            '		<label class="control-label">随访备注</label>' +
            '   	<div class="control-input">' +
            '			{{if status=="default"}}' +
            '				<textarea class="form-control" rows="{{rows?rows:3}}" name="taskNote" placeholder="{{placeHolder}}">{{taskNote}}</textarea>' +
            '			{{else if status=="readonly"}}' +
            '				<p class="form-control-static form-control-static-textarea" name="taskNote">{{taskNote}}</p>' +
            '			{{else if status=="disabled"}}' +
            '				<textarea class="form-control" rows="{{rows?rows:3}}" name="taskNote" placeholder="{{placeHolder}}" disabled>{{taskNote}}</textarea>' +
            '			{{/if}}' +
            '  		</div>' +
            '	</div>' +
            '</script>'
    }
    // 打印
    var printLoop = function () {
        return '<script id="tpl_outPatient_printLoop" type="text/html">' +
            '		{{if children}}' +
            '			{{if type=="qusetion_group" || type=="qusetion_groupCollapse"}}' +
            '				<div class="print-item clearfix">' +
            //此行div后加 </br >  是大标题换行
            '					{{if label}}<div class="print-item-tit">{{label}}：</div>{{/if}}' +
            '					<div class="print-item-con">' +
            '						{{each children as value i}}' +
            '							{{if value}}' +
            '								{{include "tpl_outPatient_printLoop",value}}' +
            '							{{/if}}' +
            '						{{/each}}' +
            '					</div>' +
            '				</div>' +
            '			{{else}}' +
            '				{{each children as value i}}' +
            '					{{if value}}' +
            '						{{include "tpl_outPatient_printLoop",value}}' +
            '					{{/if}}' +
            '				{{/each}}' +
            '			{{/if}}' +
            '		{{else}}' +
            '			{{if val}}' +
            '				{{if type == "question_multiLabelText"}}' +
            '					{{each label as item i}}' +
            '						{{if val[i]}}' +
            '							<span>{{item}}：{{val[i]}}</span>' +
            '						{{/if}}' +
            '					{{/each}}' +
            '				{{else if type == "question_uploadPictures" || type == "question_sudokuPictures"}}' +
            '					<span>{{label}}：</span>' +
            '					<div class="print-pic">' +
            '						{{each val as item i}}' +
            '							{{if item}}' +
            '								<img src="{{item}}?x-oss-process=image/resize,h_300">' +
            '							{{/if}}' +
            '						{{/each}}' +
            '					</div>' +
            '				{{else}}' +
            '					{{if label}}' +
            '						<span>{{label}}：{{val}}</span>' +
            '					{{else}}' +
            '						<span>{{val}}</span>' +
            '					{{/if}}' +
            '				{{/if}}' +
            '			{{/if}}' +
            '		{{/if}}' +
            '</script>'
    }
    var print = function () {
        return '<script id="tpl_outPatient_print" type="text/html">' +
            '<div class="print-left">' +
            '	<div>{{task.finishTime}}</div>' +
            '</div>' +
            '<div class="print-right">' +
            '	<div id="hospitalName" class="hospital-name">{{hospital.hospitalName}}</div>' +
            '	<div id="patientInfo" class="patient-info clearfix">' +
            '		<div>姓名：{{info.patientName}}</div>' +
            '		<div>性别：{{info.gender}}</div>' +
            '		<div>{{info.ageLabel}}：{{info.age}}</div>' +
            '	</div>' +
            '	<div>' +
            '		{{each rows as value1 i}}' +
            '		{{each value1 as value2 i}}' +
            '			{{include "tpl_outPatient_printLoop",value2}}' +
            '		{{/each}}' +
            '		{{/each}}' +
            '	</div>' +
            '	{{if !followupGuidance}}' +
            '	<div class="print-item clearfix">' +
            '		<div class="print-item-tit">随访指导：</div>' +
            '		<div class="print-item-con">' +
            '			{{if task.nextDateTime}}' +
            '			<span>下次随访时间：{{task.nextDateTime}}</span>' +
            '			{{/if}}' +
            '			<span>下次随访地址：{{task.nextAddress}}</span>' +
            '			{{if task.taskNote}}' +
            '			<span>随访备注：{{task.taskNote}}</span>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '	{{/if}}' +
            '</div>' +
            '</script>'
    }

    // wxf 纸质报告 打印
    var printTem2Loop = function () {
        return '<script id="tpl_outPatient_printTem2Loop" type="text/html">' +
            '		{{if children}}' +
            '			{{if type=="qusetion_group" || type=="qusetion_groupCollapse"}}' +
            '				<div class="print-item clearfix">' +
            //此行div后加 </br >  是大标题换行
            '					{{if label}}<div class="print-item-tit2">▏{{label}}</div>{{/if}}' +
            '					<div class="print-item-con2">' +
            '						{{each children as value i}}' +
            '							{{if value}}' +
            '								{{include "tpl_outPatient_printTem2Loop",value}}' +
            '							{{/if}}' +
            '						{{/each}}' +
            '					</div>' +
            '				</div>' +
            '			{{else}}' +
            '				{{each children as value i}}' +
            '					{{if value}}' +
            '						{{include "tpl_outPatient_printTem2Loop",value}}' +
            '					{{/if}}' +
            '				{{/each}}' +
            '			{{/if}}' +

            '		{{else}}' +
            '			{{if val}}' +
            '				{{if type == "question_multiLabelText"}}' +
            '					{{each label as item i}}' +
            '						{{if val[i]}}' +
            '							<span>{{item}}：{{val[i]}}</span>' +
            '						{{/if}}' +
            '					{{/each}}' +
            '				{{else if type == "question_uploadPictures" || type == "question_sudokuPictures"}}' +
            '					<span>{{label}}：</span>' +
            '					<div class="print-pic">' +
            '						{{each val as item i}}' +
            '							{{if item}}' +
            '								<img src="{{item}}?x-oss-process=image/resize,h_300">' +
            '							{{/if}}' +
            '						{{/each}}' +
            '					</div>' +


            '				{{else if id == "Pub13x00006"}}' +
            '					{{if label}}' +
            '						<span><span style="font-weight:bold;text-decoration:underline">{{label}}：</span>{{val}}</span>' +
            '						<br />' +
            '					{{else}}' +
            '						<span>{{val}}</span>' +
            '					{{/if}}' +

            '				{{else if type == "question_textarea"}}' +
            '					{{if label}}' +
            '						<span><span style="font-weight:bold;text-decoration:underline">{{label}}：</span>{{val}}</span>' +
            '						<br />' +
            '					{{else}}' +
            '						<span>{{val}}</span>' +
            '					{{/if}}' +

            '				{{else if id == "Pub13x00007"}}' +

            '				{{else}}' +
            '					{{if label}}' +
            '							{{if label=="DS/" ||  label=="DCX" || label=="→"}}' +
            '									{{label}}{{val}}' +
            '							{{else}}' +
            '								{{if label=="OD" || label=="OS"}}' +
            '									<span> </span>{{label}}：{{val}}' +
            '								{{else}}' +
            '									<span>{{label}}：{{val}}</span>' +
            '								{{/if}}' +
            '							{{/if}}' +
            '					{{else}}' +
            '						<span>{{val}}</span>' +
            '					{{/if}}' +
            '				{{/if}}' +
            '			{{/if}}' +
            '		{{/if}}' +
            '</script>'
    }
    var printTem2 = function () {
        return '<script id="tpl_outPatient_printTem2" type="text/html">' +
            '<div class="print-right2">' +
            //'	<div id="hospitalName" class="hospital-name" style="text-align: center;font-weight: bold;font-size:20px;">{{info.tenant_name}}报告单</div>'+
            '	<div id="hospitalName" class="hospital-name" style="text-align: center;font-weight: bold;font-size:20px;">{{hospital.hospitalName}}{{info.tenant_name}}报告单</div>' +
            '	<div id="patientInfo" class="patient-info2">' +
            '		<div>姓名：{{info.patientName}}</div>' +
            '		<div>性别：{{info.gender}}</div>' +
            '		<div>{{info.ageLabel}}：{{info.age}}</div>' +
            '	</div>' +


            '	<div class="print-con">' +
            '		{{each rows as value1 i}}' +
            '		{{each value1 as value2 i}}' +
            '			{{include "tpl_outPatient_printTem2Loop",value2}}' +
            '		{{/each}}' +
            '		{{/each}}' +
            '	</div>' +
            '	<div class="print-time">' +
            '			<div class="print-time-left">检查医院：{{hospital.hospitalName}}</div>' +
            '			<div class="print-time-right">指导医生：{{task.updateAuname}}</div>' +
            '			<div class="print-time-left"> </div>' +
            //'			<div class="print-time-left">下次检查地址：{{task.nextAddress}}</div>'+
            '			<div class="print-time-right">日期：{{task.myDate}}</div>' +
            //'			<div class="print-time-left">下次随访时间：{{task.nextDateTime}}</div>'+
            '	</div>' +
            '	{{if !followupGuidance}}' +
            '	<div class="print-item clearfix">' +
            '		<div class="print-item-tit2">随访指导：</div>' +
            '		<div class="print-item-con2">' +
            '			{{if task.nextDateTime}}' +
            '			<span>下次随访时间：{{task.nextDateTime}}</span>' +
            '			{{/if}}' +
            '			<span>下次随访地址：{{task.nextAddress}}</span>' +
            '			{{if task.taskNote}}' +
            '			<span>随访备注：{{task.taskNote}}</span>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +


            '	{{/if}}' +
            '</div>' +
            '</script>'
    }
    // 建档打印
    var printCreateLoop = function () {
        return '<script id="tpl_outPatient_printcreateLoop" type="text/html">' +
            '{{if children}}' +
            '{{if type=="qusetion_group" || type=="qusetion_groupCollapse"}}' +
            '<div class="print-item clearfix">' +
            '{{if label}}<div class="print-item-tit2">▏{{label}}</div>{{/if}}' +
            '<div class="print-item-con2">' +
            '{{each children as value i}}' +
            '{{if value}}' +
            '{{include "tpl_outPatient_printcreateLoop",value}}' +
            '{{/if}}' +
            '{{/each}}' +
            '</div>' +
            '</div>' +
            '{{else}}' +
            '{{each children as value i}}' +
            '{{if value}}' +
            '{{include "tpl_outPatient_printcreateLoop",value}}' +
            '{{/if}}' +
            '{{/each}}' +
            '{{/if}}' +
            '{{else}}' +
            '{{if val}}' +
            '{{if type == "question_multiLabelText"}}' +
            '{{each label as item i}}' +
            '{{if val[i]}}' +
            '<span>{{item}}：{{val[i]}}</span>' +
            '{{/if}}' +
            '{{/each}}' +
            '{{else}}' +
            '{{if label}}' +
            '<span>{{label}}：{{val}}</span>' +
            '{{else}}' +
            '<span>{{val}}</span>' +
            '{{/if}}' +
            '{{/if}}' +
            '{{/if}}' +
            '{{/if}}' +
            '</script>'
    }
    var printCreate = function () {
        return '<script id="tpl_outPatient_printcreate" type="text/html">' +
            '<div class="print-right2">' +
            '<div id="hospitalName" class="hospital-name" style="text-align: center;font-weight: bold;font-size:20px;margin-bottom: 10px">建档信息记录表</div>' +

            '<div class="print-con">' +
            '{{each rows as value1 j}}' +
            '{{each value1 as value2 i}}' +
            '{{include "tpl_outPatient_printcreateLoop",value2}}' +
            '{{/each}}' +
            '{{/each}}' +
            '</div>' +

            '</div>' +
            '</script>'
    }

    // 锚点导航
    var anchorMenu = function () {
        return '<script id="tpl_outPatient_anchorMenu" type="text/html">' +
            '	 <div class="anchor-menu-fold">问卷导航</div>' +
            '    <div class="anchor-menu-unfold">' +
            '        <div class="anchor-menu-tit clearfix">' +
            '            <span class="anchor-menu-close">关闭</span>' +
            '            <span class="anchor-menu-name">问卷导航</span>' +
            '        </div>' +
            '        <div class="anchor-menu-list">' +
            '            <ul>' +
            '				{{each list as value i}}' +
            '                <li {{if i==0}}class="active"{{/if}}><a class="ellipsis-1" id="{{value.id}}" href="#{{value.id}}">{{value.label}}</a></li>' +
            '				{{/each}}' +
            '            </ul>' +
            '        </div>' +
            '    </div>' +
            '</script>'
    }
    var dischargeSummary = function () {
        return '<script id="tpl_outPatient_dischargeSummary" type="text/html">' +
            '	<div class="discharge-summary">' +
            '		<div class="picture">' +
            '			<img src="">' +
            '		</div>' +
            '		<div class="list">' +
            '			{{if page > "1"}}' +
            '				<div class="arrow-left"><i class="fa fa-arrow-circle-left"></i></div>' +
            '			{{/if}}' +
            '			<ul class="clearfix">' +
            '				{{each list as value i}}' +
            '					<li><img src="{{value.imgNewUrl}}"></li>' +
            '				{{/each}}' +
            '			</ul>' +
            '			{{if page < pages}}' +
            '				<div class="arrow-right"><i class="fa fa-arrow-circle-right"></i></div>' +
            '			{{/if}}' +
            '		</div>' +
            '	</div>' +
            '</script>'
    }

    return tpl
})
